package iyuwu.PlayerManager;

import org.bukkit.BanList;
import org.bukkit.Bukkit;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;

public class unban implements CommandExecutor {
    @Override
    public boolean onCommand(CommandSender sender, Command command, String s, String[] args) {
        if(!sender.hasPermission("unban.use")){
            sender.sendMessage("你没有权限");
            return true;
        }
        if(args==null){
            sender.sendMessage("/unban <player>");
            return true;
        }
        else{
            Bukkit.getBanList(BanList.Type.NAME).pardon(args[0]);
            sender.sendMessage("解封成功");
            return true;
        }
    }
}
